
<%@ page contentType="text/html;charset=UTF-8" %>
<%//@include file="../../common/sessionValidate.jsp" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String filegroup = String.valueOf(System.currentTimeMillis());
%>
<!DOCTYPE HTML>
<html lang="UTF-8">
<head>
    <title>申请信息</title>
    <%@ include file="../../common/meta.jsp" %>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <link rel="stylesheet" href="<%=basePath%>css/my-bootstrap.css" media="screen" id="tuserskin">
    <link rel="stylesheet" href="<%=basePath%>js/toastr/toastr.css">
    <link rel="stylesheet" href="<%=basePath%>css/bootstrapValidator.min.css">
    <link rel="stylesheet" href="<%=basePath%>css/font-awesome.min.css">
    <!-- kind富文本编辑器  start-->
    <link rel="stylesheet" href="<%= basePath %>kindeditor/themes/default/default.css"/>
    <link rel="stylesheet" href="<%= basePath %>kindeditor/plugins/code/prettify.css"/>
    <script charset="utf-8" src="<%= basePath %>kindeditor/kindeditor.js"></script>
    <script charset="utf-8" src="<%= basePath %>kindeditor/lang/zh-CN.js"></script>
    <script charset="utf-8" src="<%= basePath %>kindeditor/plugins/code/prettify.js"></script>
    <!-- kind富文本编辑器  end-->
    <script type="text/javascript" src="<%= basePath %>js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="<%= basePath %>js/jquery.cookie.js"></script>
</head>
<style>
    hr {
        margin-top: 1px;
        border-bottom: 1px solid #1BBC9B;
    }
</style>
<script>
    var editor101; //后面赋值通过该全局变量执行；
    KindEditor.ready(function (K) {
        editor101 = K.create('textarea[name="editor101"]', {
            uploadJson: '<%= basePath %>upload/uploadFile',  //选择本地文件上传处理；
            fileManagerJson: '<%= basePath %>upload/uploadFileManager', //服务器文件浏览；
            allowFileManager: true,	//true时显示浏览远程服务器按钮。
            allowImageUpload: true	//true时显示图片上传按钮。
        });
        prettyPrint(); //google美化高亮显示富文本中html代码js；
    });
</script>
<body>
<form class="form-horizontal form-bordered form-row-strippe" name="ffAdd" id="ffAdd" mentod="post" role="form"
      data-toggle="validator" enctype="multipart/form-data">
    <div class="" style="margin-right:2px;padding-right:1px;">

        <!-------------------------- 面板  start--------------------------------->
        <div class="panel panel-primary">
            <div class="panel-heading clearfix" id="addHeaderDiv">
            </div>
            <div class="panel-body">
                <div class="row">
                    <h5>&nbsp;&nbsp;基本信息
                        <span class="text-right pull-right" id="buttonDivTB"></span>&nbsp;&nbsp;&nbsp;&nbsp;
                    </h5>
                    <hr>

                    <div class="col-xs-12">
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2"><strong><font color="red">*</font>标题</label>
                                <div class="col-xs-10">
                                    <input id="title" name="title" class="form-control" value=""
                                           placeholder="采购申请（非工程类）,请输入信息！"></input>
                                    <input id="content" name="content" type="hidden"/>
                                    <input id="id" name="id" type="hidden"/>
                                    <input id="biztype" name="biztype" type="hidden" value="MyApply"/>
                                    <input id="level1name" name="level1name" type="hidden" value="采购申请(非工程类)"/>
                                    <input id="level3name" name="level3name" type="hidden"/>
                                    <input id="types" name="types" type="hidden" value="CgsqApply"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2"><font color="red">*</font>费用分摊部门</label>
                                <div class="col-xs-10">
                                    <input id="check2" name="check2" type="text" class="form-control"
                                           placeholder="请选择费用分摊部门" readonly />
                                    <button class="btn btn-primary btn-small" data-toggle="modal"
                                            data-target="#myModalRoles">选择
                                    </button> <a href="#" onclick="cleanRoles()">清空</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--end 换列--><!--start 换列-->
                    <div class="col-xs-12">
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2">备注</label>
                                <div class="col-xs-10">
                                    <input id="newfrom" name="newfrom" type="text"  value=""
                                           class="form-control" placeholder="" />
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2">申请部门</label>
                                <div class="col-xs-10">
                                    <input id="hticount" name="hticount" type="text"
                                           value="<%=request.getSession().getAttribute("FREE_BRANCH_NAME") %>"
                                           class="form-control" placeholder="" readonly="true"/>
                                </div>
                            </div>
                        </div>
                    </div><!--end 换列--><!--start 换列-->
                    <div class="col-xs-12">
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2">申请人</label>
                                <div class="col-xs-10">
                                    <input id="creater" name="creater" type="text"
                                           value="<%=request.getSession().getAttribute("username") %>"
                                           class="form-control" placeholder="" readonly="true"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2">申请时间</label>
                                <div class="col-xs-10">
                                    <input id="creattime" name="creattime" type="text" class="form-control"
                                           placeholder="" readonly="true"/>
                                </div>
                            </div>
                        </div>
                    </div><!--end 换列--><!--start 换列-->
                    <div class="col-xs-12">
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2"><strong>上传附件</strong></label>
                                <div class="col-xs-10">
                                    <a href="#" onclick="javascript:window.open('<%=basePath%>upload/toUploadOneFile2?oldfilename=ext9&newfilename=imagepath&filegroup=<%=filegroup%>','','status=yes,scrollbars=yes,location=no,top=300,left=500,width=420,height=300')">上传附件</a>
                                    <input id="imagepath" name="imagepath" type="hidden" value="" class="form-control" />
                                    <input id="ext9" name="ext9" type="hidden" value="" class="form-control" />
                                    <input id="ranger" name="ranger" type="hidden" value="<%=filegroup%>" class="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-6">
                            <div class="form-group">
                                <label class="control-label col-xs-2"><strong>附件列表</strong></label>
                                <div class="col-xs-10">
                                    <table border="0" id="filetableDiv">
                                        <thead id="grid_head">
                                        <tr><td></td></tr>
                                        <tbody id="fileListDiv"></tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--end 换列--><!--start 换列-->
                    <div class="col-xs-12">
                        <!--<div class="col-xs-12">start 换列-->
                        <div class="col-xs-12">
                            <div class="form-group">
                                <label class="control-label col-xs-5"><strong><font color="red">*</font>内容(包含：<font color="red">物品名称，品牌规格，数量，单位，申请事由，</font><font color="black">备注 </font>)</label>
                                <div class="col-xs-7">  </div>
                            </div>
                        </div>
                    </div><!-- end 内容 -->
                    <!--end 换列--><!--start 换列-->
                    <div class="col-xs-12">
                        <!--<div class="col-xs-12">start 换列-->
                        <div class="col-xs-12">
                            <div class="form-group">
                                <label class="control-label col-xs-1"> </label>
                                <div class="col-xs-11">
                                    <div class="form-group">&nbsp;&nbsp;&nbsp;&nbsp;
                                        <textarea id="editor101" name="editor101" rows="15" cols="200"
                                                  style=" width:98%; height:300px;"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div><!-- end 内容 -->

                </div><!--end body-->
                <div class="modal-footer bg-info " id='buttonDiv'>
                </div>
            </div>
            <!--------------------------面板 end------------------------------------>

        </div>
    </div>
</form>

<!-- 模态框（Modal）start -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">提示</h4>
            </div>
            <div class="modal-body" id="myModalMessDiv"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<!-- 模态框（Modal）end -->

<!--------------------------模态框 面板 start ------------------------------------>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModalRoles" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true"  style="height:600px; overflow:scroll;" >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="myModalLabelRoles">选择分摊费用部门</h4>
            </div>
            <div class="modal-body">
                <!--------------------------信息列表：带表格面板  start--------------------------------->
                <p>每页显示<select id="pageSizeRoles" class=" label-primary" onchange="SearchRoles(0)">
                    <option value="10">10</option>
                    <option value="20">20</option>
                    <option value="30">30</option>
                    <option value="50">50</option>
                    <option value="500">500</option>
                </select>条记录，&nbsp;&nbsp;&nbsp;&nbsp;共有记录：<span id="totalCountRoles"  class="label label-primary">0</span> 条，总页数：<span
                        id="totalPageNoRoles" class="label label-primary">0</span>页。
                </p>
                <table id="gridRoles" class="table table-condensed table-striped table-bordered table-hover"
                       class="sortable" cellpadding="0" cellspacing="0" border="0" class="display" width="100%">
                    <thead id="grid_headRoles">
                    <tr>
                        <th onclick="sortTableT.sort('grid',0,'String')"></th>
                        <th onclick="sortTableT.sort('grid',0,'String')">部门id</th>
                        <th onclick="sortTableT.sort('grid',0,'String')">部门名称</th>
                        <th onclick="sortTableT.sort('grid',0,'String')">状态</th>
                    </tr>
                    </thead>
                    <tbody id="grid_bodyRoles"></tbody>
                </table>
                <div class="paging-toolbar">
                    <ul class="pager" style='margin-bottom:5px;' id='grid_pagingRoles'></ul>
                </div>

                <!--------------------------信息列表：带表格面板 end------------------------------------>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="setSelectRoles()">确认</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!--------------------------模态框 面板 end ------------------------------------>

</body>
</html>
<%!
    private String htmlspecialchars(String str) { //kindeditor去掉富文本中非法字符；
        str = str.replaceAll("&", "&amp;");
        str = str.replaceAll("<", "&lt;");
        str = str.replaceAll(">", "&gt;");
        str = str.replaceAll("\"", "&quot;");
        return str;
    }
%>
<script src="<%=basePath%>js/bootstrap.min.js"></script>
<script src="<%=basePath%>js/bootstrap-paginator.min.js"></script>
<script src="<%=basePath%>/js/respond.js"></script>
<script src="<%=basePath%>/js/html5.js"></script>
<script src="<%=basePath%>js/toastr/toastr.js"></script>
<script src="<%=basePath%>js/bootbox.js"></script>
<script src="<%=basePath%>js/jquery.validate.js"></script>
<script src="<%=basePath%>js/my-jquery-curd.js"></script>
<script src="<%=basePath%>js/tableSortTool.js"></script>
<script src="<%=basePath%>js/calendar.js"></script>
<script type="text/javascript">
    function cleanRoles() {
        //document.getElementsByName("userid").val ="";
        $("#check2").val("");
        //alert("userid="+$("#userid").val);
    }

    function setSelectRoles() {
        var obj,count,checkvalue;
        checkvalue="";
        obj=document.getElementsByName("batchSelectedRoles");
        count=0;
        //alert("obj="+obj+";obj.length="+obj.length);
        for(i=0;i<obj.length;i++)
        {
            if(obj[i].checked==true)
            {
                count++;
                checkvalue = checkvalue + obj[i].value  +",";
            }
        }
        $("#check2").val(checkvalue);
        $('#myModalRoles').modal('hide');  //模态框隐藏
    }
    //根据查询条件，查询列表数据并显示
    function SearchRoles(startIndex){
        var pageSize = 1000;
        var condition = $("#form2").serialize();
        var url = "<%=basePath%>t_branch/getAllT_branch?startIndex="+startIndex+"&pageSize="+pageSize+"&"+condition+"&time="+Math.random();
        //alert(url);
        $.getJSON(url, function (data){
            //$("#pageSize").html(data.pageSize);
            $("#totalCountRoles").html(data.totalCount);
            $("#totalPageNoRoles").html(data.totalPageNo);
            $("#grid_bodyRoles").html("");

            //1、表格行内容输出
            $.each(data.items, function(i,item){
                var str="<tr>";
                str+="<td><input class='checkboxes' name='batchSelectedRoles' id='batchSelectedRoles' type='checkbox' value='"+item.name+"("+item.id+")'></td>";
                str+="<td>"+doNull(item.id)+"</td>";
                str+="<td>"+doNull(item.name)+"</td>";
                if(item.status==1){
                    str+="<td><span class='label label-success'>有效</span></td>";
                }else{
                    str+="<td><span class='label label-danger'>无效</span></td>";
                }
                str+="</tr>";
                $("#grid_bodyRoles").append(str);
            });//end each data;

            //2、分业处理
            var element = $("#grid_pagingRoles");
            if(data.totalCount>0){
                //第二种处理分页方案，直接生成分页html内容，然后.html()到目标对象；
                var pageHtml ="";
                pageHtml +='<li><button type="button" class=" btn btn-primary btn-sm " onclick="SearchRoles('+data.firstIndex+')">首页</button></li>';
                pageHtml +='<li><button type="button" class=" btn btn-primary btn-sm " onclick="SearchRoles('+data.previousIndex+')">上一页</button></li>';
                pageHtml +='<li><button type="button" class=" btn btn-primary btn-sm " >当前第  '+data.currentPageNo+' 页</button></li>';
                pageHtml +='<li><button type="button" class=" btn btn-primary btn-sm " onclick="SearchRoles('+data.nextIndex+')">下一页</button></li>';
                pageHtml +='<li><button type="button" class=" btn btn-primary btn-sm " onclick="SearchRoles('+data.lastIndex+')">尾页</button></li>';
                element.html(pageHtml);
            }else{
                element.html("");
            }
        })//end getJSON;
    }

    //新增保存数据
    function add() {
        editor101.sync();
        var content = editor101.html();  //CKEDITOR.instances.editor101.getData();
        if (content == "" || content == null) {
            alert("内容不能为空！");
            return false;
        } else {
            $("#content").val(content);
        }

        $("#addSaveButton").attr("disabled", true);
        var url = "<%=basePath%>t_news/saveT_news?time=" + Math.random();
        var postData = $("#ffAdd").serializeArray();
        $.post(url, postData, function (data) {
            if (data.result == "success") {
                showSuccessTips("恭喜保存成功!", "提示");  //保存成功  1.关闭弹出层，
            } else {
                $("#addSaveButton").removeAttr("disabled");
                $("#myModal").modal('show'); //hide;
                $("#myModalMessDiv").html("<font color='red'>对不起,保存数据失败，失败原因：" + data.info + "</font>");
                return false;
            }
        }).error(function () {
            $("#addSaveButton").removeAttr("disabled");
            //showErrorTips("保存数据失败!", "错误信息：");
            $("#myModal").modal('show'); //hide;
            $("#myModalMessDiv").html("<font color='red'>对不起,保存数据失败，失败原因：" + data.info + "</font>");
        });
    }

    //更新修改数据到后台
    function edit() {
        editor101.sync();
        var content = editor101.html();
        if (content == "" || content == null) {
            alert("内容不能为空！");
            return false;
        }
        $("#content").val(content);
        $("#editSaveButton").attr("disabled", true);
        var url = "<%=basePath%>t_news/updateT_news?time=" + Math.random();
        myEdit2(url);
    }

    //更新修改数据到后台并且启动工作流
    function tjsh() {
        $("#editSaveButton").attr("disabled", true);
        $("#tjshSaveButton").attr("disabled", true);
        var url = "<%=basePath%>t_news/tjshT_news?time=" + Math.random();
        myCurdTjsh(url);
    }

    //初始化数据档案类型下拉框；
    function initDataGroup(){
        var purl = "<%=basePath%>t_data_dic/getAllT_data_dic?data_group=danganguanli&flag=1&startIndex=0&pageSize=1000&time="+ Math.random();
        $.getJSON(purl, function(data) {
            var optionHtml = "";
            $.each(data.items, function(i, item) {
                optionHtml+= "<option value='"+item.data_no+"'>"+item.data_name+"</option>";
            });//end each
            $("#types").append(optionHtml);
        }); //end getJson
    }

    //展示附件文件列表；
    function showFileList(oldfilenames, newfilenames){
        var showmess= oldfilenames.split(";");
        var newfilename= newfilenames.split(";");
        var trtdlist = "";
        for (var i = 0; i < showmess.length; i++ ){
            trtdlist += "<tr><td><a href='<%=basePath%>download?filename="+newfilename[i]+"'>"+showmess[i]+"</a></td></tr>";
        }
        $("#fileListDiv").html("");
        document.getElementById("fileListDiv").innerHTML = trtdlist;
    }

    //删除附件
    function deleteAllFile(id) {
        var url = "<%=basePath%>t_news/delT_newsAllFile?id=" + id + "&time=" + Math.random();
        bootbox.confirm({
            size: 'small',
            buttons: {
                confirm: {
                    label: ' 删除 ',
                    className: 'btn btn-sm btn-danger'
                },
                cancel: {
                    label: '   取消     ',
                    className: 'btn btn-success btn-sm'
                }
            },
            message: '您确认要删除全部附件？删除后根据需要重新上传！',
            callback: function (result) {
                if (result) {
                    if (result) {
                        myNewsAllFileDel(url);
                    }
                }
            },
            title: '删除附件提示：',
            className: ' '
        })
    }

    //删除楼栋附件
    function myNewsAllFileDel(url) {
        $.get(url, function (data) {
            if ("success" == data.result) {
                showSuccessTips("删除成功", "提示");
                $("#fileListDiv").html("");
                $("#imagepath").val("");
                //$("#attach").val("");
                $("#ext9").val("");
            } else {
                showErrorTips("删除数据" + id + "失败!", "错误信息：");
            }
        });
    }

    //初始化页面及校验
    $().ready(function () {
        //1、初始化数据显示
        var optype = '<%=request.getParameter("oplx")%>';
        var id = '<%=request.getParameter("id")%>';
        var functname = "采购申请";//'<%=request.getParameter("functname")%>';
        var functid = '<%=request.getParameter("functid")%>';
        var name = functname; //"新闻";

        if (optype == 'add') {
            $("#ffAdd")[0].reset();/*重置表单*/
            var basePath = "<i class='icon-plus'></i>&nbsp;";
            setHeader2("添加" + functname, basePath);//设置addHeaderDiv标题文字及按钮
            setButtonDivAdd2();//设置底部adddiv的 操作按钮
            initTime("newdate", "2");
            initTime("creattime", "1");
            //initDataGroup();

            SearchRoles(0);
        } else if (optype == 'edit') {
            var basePath = "<i class='icon-pencil'></i>&nbsp;";
            setHeader2("修改" + functname, basePath);//设置addHeaderDiv标题文字及按钮
            setButtonDivEdit4();//设置adddiv的 操作按钮
            //initDataGroup();
            var url = "<%=basePath%>t_news/getT_news?id=" + id + "&time=" + Math.random();
            $.getJSON(url, function (data) {//获取数据，并且自动填充form，自动代码待修改； @todo;
                setValue(data);
                showFileList(data.ext9, data.imagepath); //设置附件列表展示；
                //如果有附件信息，显示“删除全部” 按钮； 如果没有附件，不显示“删除全部”； 可以放到commonFileUpload2.jsp中去改，否则影响所有用到上传的页面； @todo
                var trtdlist ="";
                //if(null != data.ext9 && !"".equals(data.ext9)){
                    trtdlist = "<a href='javascript:deleteAllFile(<%=request.getParameter("id")%>)' class='text-danger'>&nbsp;&nbsp;<span class='icon-remove' style='color:rgb(0, 128, 255)'></span>删除全部附件</a>&nbsp;&nbsp;";
                // }else{
                //     trtdlist ="";
                // }
                $("#fileListDiv").append(trtdlist);
                editor101.html(data.content);
                //$("#effect_date").val(jsonDateFormat($("#effect_date").val())); //重新设置日期类型的值
            });
            SearchRoles(0);
        } else if (optype == 'view') {
            var basePath = "<i class='icon-eye-open'></i>&nbsp;";//设置addHeaderDiv标题文字及按钮
            setHeader2("查看" + functname, basePath);
            setButtonDivView2();//设置adddiv的 操作按钮
            //initDataGroup();
            var url = "<%=basePath%>t_news/getT_news?id=" + id + "&time=" + Math.random();
            $.getJSON(url, function (data) {//获取数据，并且自动填充form，自动代码待修改； @todo;
                setValue(data);
                showFileList(data.ext9, data.imagepath); //设置附件列表展示；
                editor101.html(data.content);
            });
            formReadOnly('ffAdd');//设置表单不可修改
        }

        //2、校验脚本初始化，start check
        $("#ffAdd").validate({
            submitHandler: function (form) {
                if ($("#opType").val() == "add") {
                    add();
                } else if ($("#opType").val() == "edit") {
                    edit();
                }
            },
            rules: {
                id: {
                    //required: true,
                    digits: true,
                    //minlength: 1,
                    maxlength: 11
                },
                types: {
                    //required: true,
                    maxlength: 45
                },
                title: {
                    required: true,
                    maxlength: 256
                },
                creater: {
                    //required: true,
                    maxlength: 45
                },
                updater: {
                    //required: true,
                    maxlength: 45
                },
                publisher: {
                    //required: true,
                    maxlength: 45
                },
                creattime: {
                    //required: true,
                    maxlength: 45
                },
                updattime: {
                    //required: true,
                    maxlength: 45
                },
                publishtime: {
                    //required: true,
                    maxlength: 45
                },
                checker: {
                    required: true,
                    number: true,
                    maxlength: 6
                },
                checktime: {
                    //required: true,
                    maxlength: 45
                },
                hticount: {
                    //required: true,
                    maxlength: 45
                },
                newfrom: {
                    //required: true,
                    maxlength: 256
                },
                color: {
                    //required: true,
                    maxlength: 45
                },
                size: {
                    //required: true,
                    maxlength: 45
                },
                zg: {
                    //required: true,
                    maxlength: 128
                },
                cq: {
                    //required: true,
                    maxlength: 512
                },
                content: {
                    //required: true,
                    maxlength: 6000
                },
                memo: {
                    //required: true,
                    maxlength: 1024
                },
                ext1: {
                    //required: true,
                    maxlength: 45
                },
                ext2: {
                    //required: true,
                    maxlength: 45
                },
                ext3: {
                    //required: true,
                    maxlength: 45
                },
                ext4: {
                    //required: true,
                    maxlength: 256
                },
                ext5: {
                    //required: true,
                    maxlength: 256
                },
                ext6: {
                    //required: true,
                    maxlength: 256
                },
                ext7: {
                    required: true,
                    maxlength: 512
                },
                ext8: {
                    //required: true,
                    maxlength: 512
                },
                ext9: {
                    //required: true,
                    maxlength: 512
                },
                status: {
                    //required: true,
                    maxlength: 45
                },
                check2: {
                    required: true,
                    maxlength: 45
                },
                classes: {
                    //required: true,
                    maxlength: 45
                },
                checkstatus: {
                    //required: true,
                    maxlength: 45
                },
                link: {
                    //required: true,
                    maxlength: 512
                },
                newdate: {
                    //required: true,
                    maxlength: 45
                },
                descriptions: {
                    //required: true,
                    maxlength: 1024
                },
                level1: {
                    //required: true,
                    maxlength: 45
                },
                level2: {
                    //required: true,
                    maxlength: 45
                },
                level3: {
                    //required: true,
                    maxlength: 45
                },
                level1name: {
                    //required: true,
                    maxlength: 45
                },
                level2name: {
                    //required: true,
                    maxlength: 45
                },
                level3name: {
                    //required: true,
                    maxlength: 45
                },
                imagepath: {
                    //required: true,
                    maxlength: 512
                },
                shownum: {
                    //required: true,
                    digits: true,
                    //minlength: 1,
                    maxlength: 11
                },
                ranger: {
                    //required: true,
                    maxlength: 45
                }
            }, //end rules;
            messages: {
                id: {
                    //required: "主键不能为空！",
                    digits: "<font color='red'>请输入数字，不能输入非数字字符！</font>",
                    //minlength: "<font color='red'>最少输入1位！</font>",
                    maxlength: "<font color='red'>主键最大支持11位，输入的数据已经超过最大长度！</font>"
                },
                types: {
                    maxlength: "<font color='red'>新闻类型最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                title: {
                    required: "<font color='red'>不能为空！</font>",
                    maxlength: "<font color='red'>最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                creater: {
                    maxlength: "<font color='red'>录入人最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                extdouble1: {
                    //required: "显示顺序不能为空！",
                    digits: "<font color='red'>请输入数字，不能输入非数字字符！</font>",
                    //minlength: "<font color='red'>最少输入1位！</font>",
                    maxlength: "<font color='red'>显示顺序最大支持11位，输入的数据已经超过最大长度！</font>"
                },
                updater: {
                    maxlength: "<font color='red'>更新人最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                publisher: {
                    maxlength: "<font color='red'>发布人最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                creattime: {
                    maxlength: "<font color='red'>录入时间最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                updattime: {
                    maxlength: "<font color='red'>更新时间最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                publishtime: {
                    maxlength: "<font color='red'>发布时间最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                checker: {
                    required: "<font color='red'> 不能为空！</font>",
                    number: "<font color='red'> 请输入数字！</font>",
                    maxlength: "<font color='red'>  最大支持 6 位,输入的数据已经超过最大长度！</font>"
                },
                checktime: {
                    maxlength: "<font color='red'>审核时间最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                hticount: {
                    maxlength: "<font color='red'>点击率最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                newfrom: {
                    maxlength: "<font color='red'>来源最大支持256位,输入的数据已经超过最大长度！</font>"
                },
                color: {
                    maxlength: "<font color='red'>颜色最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                size: {
                    maxlength: "<font color='red'>标题字体最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                zg: {
                    maxlength: "<font color='red'>撰稿摄影最大支持128位,输入的数据已经超过最大长度！</font>"
                },
                cq: {
                    maxlength: "<font color='red'>错情最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                content: {
                    maxlength: "<font color='red'>内容最大支持6,000位,输入的数据已经超过最大长度！</font>"
                },
                memo: {
                    maxlength: "<font color='red'>备注最大支持1,024位,输入的数据已经超过最大长度！</font>"
                },
                ext1: {
                    maxlength: "<font color='red'> ext1最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                ext2: {
                    maxlength: "<font color='red'> ext2最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                ext3: {
                    maxlength: "<font color='red'> ext3最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                ext4: {
                    maxlength: "<font color='red'> ext4最大支持256位,输入的数据已经超过最大长度！</font>"
                },
                ext5: {
                    maxlength: "<font color='red'> ext5最大支持256位,输入的数据已经超过最大长度！</font>"
                },
                ext6: {
                    maxlength: "<font color='red'> ext6最大支持256位,输入的数据已经超过最大长度！</font>"
                },
                ext7: {
                    required: "<font color='red'>视频不能为空！</font>",
                    maxlength: "<font color='red'> 视频最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                ext8: {
                    maxlength: "<font color='red'> ext8最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                ext9: {
                    maxlength: "<font color='red'> ext9最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                status: {
                    maxlength: "<font color='red'>状态最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                check2: {
                    required: "<font color='red'>费用分摊部门不能为空！</font>",
                    maxlength: "<font color='red'>最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                classes: {
                    maxlength: "<font color='red'>扩展类型最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                checkstatus: {
                    maxlength: "<font color='red'>审核状态最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                link: {
                    maxlength: "<font color='red'>链接地址最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                newdate: {
                    maxlength: "<font color='red'>新闻日期最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                descriptions: {
                    maxlength: "<font color='red'>说明最大支持1,024位,输入的数据已经超过最大长度！</font>"
                },
                level1: {
                    maxlength: "<font color='red'>栏目1级最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                level2: {
                    maxlength: "<font color='red'>栏目2级最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                level3: {
                    maxlength: "<font color='red'>栏目3级最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                level1name: {
                    maxlength: "<font color='red'> level1name最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                level2name: {
                    maxlength: "<font color='red'> level2name最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                level3name: {
                    maxlength: "<font color='red'> level3name最大支持45位,输入的数据已经超过最大长度！</font>"
                },
                imagepath: {
                    required: "<font color='red'>截图不能为空！</font>",
                    maxlength: "<font color='red'>截图最大支持512位,输入的数据已经超过最大长度！</font>"
                },
                shownum: {
                    //required: "显示顺序不能为空！",
                    digits: "<font color='red'>请输入数字，不能输入非数字字符！</font>",
                    //minlength: "<font color='red'>最少输入1位！</font>",
                    maxlength: "<font color='red'>显示顺序最大支持11位，输入的数据已经超过最大长度！</font>"
                },
                ranger: {
                    maxlength: "<font color='red'>范围最大支持45位,输入的数据已经超过最大长度！</font>"
                }
            } //end message;
        }); //end validate;
    }) //end funciton read;
</script>
